<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="nuffzone.*"%>


<html>

<head>
<title>Nuffzone-Home</title>

<link type="text/css" rel="stylesheet" href="/stylesheets/home.css" />
<link type="text/css" rel="stylesheet" href="/stylesheets/common.css" />
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/script.js"></script>
<script type="text/javascript" src="scripts/RSA.js"></script>
<%
	String pagina = request.getParameter("page");
%>

<%!public static String convertSimple(int i) {
		return "" + i;
	}%>
<%
	UserService userService = UserServiceFactory.getUserService();
	User user = userService.getCurrentUser();
%>


</head>




<body>
	<div id="pageHeader">
		<div id="usernameTopDiv">
			<p id="usernameText">
				<%
					if (user != null) {
				%>
				<%=user.getNickname()%>
				<%
					}
				%>
			</p>
		</div>
		<div id="navigationBar">
			<div id="navHome" class="navigation-div">
				<div id="nav-icon-home" class="navIcon"></div>
				<div class="navText">Homepage</div>
			</div>
			<div id="navSchedule" class="navigation-div">
				<div id="nav-icon-schedule" class="navIcon"></div>
				<div class="navText">Schedule</div>
			</div>
			<div id="navRSA" class="navigation-div">
				<div id="nav-icon-rsa" class="navIcon"></div>
				<div class="navText">Cryptografie</div>
			</div>
			<div id="navRecipe" class="navigation-div">
				<div id="nav-icon-recipes" class="navIcon"></div>
				<div class="navText">Recipes</div>
			</div>
		</div>
		<div id="dateTopDiv">
			<p id="dateText">
				<%
					Date today;
					String dateOut;
					DateFormat dateFormatter;
					dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT);
					today = new Date();
					dateOut = dateFormatter.format(today);
				%>
				<%=dateOut%></p>
		</div>
	</div>
	<div id="middleSectionContainer">
	<div id="middleSection">



		<!-- HOME CONTENT -->


		<div id="contentDivHome" class="contentDiv">
			<div id="infoDivHome" class="content-container">
				<div id="infoHeaderHome" class="header">General Information</div>
				<div id="infoContentHome" class="content">

					<%
						if (user != null) {
					%>
					<p>
						Welcome
						<%=user.getNickname()%>! You can <a
							href="<%=userService.createLogoutURL(request.getRequestURI())%>">sign
							out</a>.
					</p>
					<%
						} else {
					%>
					<p>
						Hello! <a
							href="<%=userService.createLoginURL(request.getRequestURI())%>">Please,
							sign in</a>
					</p>
					<%
						}
					%>
				</div>
			</div>
			<div id="messageBoardDiv" class="content-container">
				<div id="messageBoardHeader" class="header">Message Board</div>
				<div id="messageBoardContent" class="content">
					<div id="messageList">
						<%
							messageManager MM = messageManager.getInstance();
							ArrayList<Message> messageListUnordered = MM.getAllMessagesAsList();
							TreeMap<Date, Message> messageMap = new TreeMap<Date, Message>(
									Collections.reverseOrder());
							for (Message message : messageListUnordered) {
								Date date = message.getDate();
								messageMap.put(date, message);
							}
							Collection<Message> messageList = messageMap.values();
							if (messageList.size() >= 1) {
								for (Message message : messageList) {
									Date date = message.getDate();
									Calendar calendar = GregorianCalendar.getInstance(); // creates a new calendar instance
									calendar.setTime(date); // assigns calendar to given date
									int hour = calendar.get(Calendar.HOUR_OF_DAY);
									hour = hour + 1;
									String hours = convertSimple(hour);
									String minutes = "";
									int min = calendar.get(Calendar.MINUTE);
									if (min < 10) {
										minutes = "0"
												+ convertSimple(calendar.get(Calendar.MINUTE));
									} else {
										minutes = convertSimple(calendar.get(Calendar.MINUTE));
									}
						%>
						<div class="message">
							<div class="messageText"><%=message.getMessage()%></div>
							<div class="messageInfo">
								<div class="messageUser"><%=message.getUser()%></div>
								<div class="messageDate"><%=message.getDateFormatted()%></div>
								<div class="messageTime"><%=hour%>:<%=minutes%></div>
							</div>
						</div>
						<%
							}
							}
						%>
					</div>
					<div id="messageBoardInput">
						<form id="messageForm" action="messageservlet" method="get">
							Message: <input type="text" name="message" size="136"
								maxlength="140" /> <input type="submit" value="Post!" />
						</form>
						<%
							if (user != null) {
						%>
						<div id="messageInputText">Type in your message and click
							Post! (max 140 characters)</div>
						<%
							} else {
						%>
						<div id="messageInputText">Please log in to use the
							message-board.</div>
						<%
							}
						%>
					</div>
				</div>
			</div>
				<div id="notesDiv" class="content-container">
					<div id="notesHeader" class="header">Notes</div>
					<div id="notesContent" class="content">
						<%
							noteManager NM = noteManager.getInstance();
							if (user != null) {
								ArrayList<Note> noteListUnordered = NM
										.getAllNotesAsListFromUser(user);
								ArrayList<Note> noteListHighPriority = new ArrayList<Note>();
								ArrayList<Note> noteListMediumPriority = new ArrayList<Note>();
								ArrayList<Note> noteListLowPriority = new ArrayList<Note>();
								if (noteListUnordered.size() >= 1) {

									for (Note n : noteListUnordered) {
										String priority = n.getPriority();
										if (priority.equals("High")) {
											noteListHighPriority.add(n);
										}
										if (priority.equals("Medium")) {
											noteListMediumPriority.add(n);
										}
										if (priority.equals("Low")) {
											noteListLowPriority.add(n);
										}
									}
									if (noteListHighPriority.size() >= 1) {

										for (Note note : noteListHighPriority) {
						%>
						<div class="note">
							<div class="notePriority" id="High"><%=note.getPriority()%></div>
							<div class="noteText"><%=note.getNote()%></div>
							<div id="<%=note.getId()%>" class="noteDeleteDiv" onclick="deleteNote(this.id)"></div>
						</div>
						<%
							}
						%>
						<%
							}
						%>
						<%
							if (noteListMediumPriority.size() >= 1) {

										for (Note note : noteListMediumPriority) {
						%>
						<div class="note">
							<div class="notePriority" id="Medium"><%=note.getPriority()%></div>
							<div class="noteText"><%=note.getNote()%></div>
							<div id="<%=note.getId()%>" class="noteDeleteDiv" onclick="deleteNote(this.id)"></div>							
						</div>
						<%
							}
						%>
						<%
							}
						%>
						<%
							if (noteListLowPriority.size() >= 1) {

										for (Note note : noteListLowPriority) {
						%>
						<div class="note">
							<div class="notePriority" id="Low"><%=note.getPriority()%></div>
							<div class="noteText"><%=note.getNote()%></div>
							<div id="<%=note.getId()%>" class="noteDeleteDiv" onclick="deleteNote(this.id)"></div>
						</div>
						<%
							}
						%>
						<%
							}
						%>

						<%
							}
						%>
						<%
							} else {
						%>
						<div id="notesNoUser">
							Please <a
								href="<%=userService.createLoginURL(request.getRequestURI())%>">sign
								in</a> in order to create and view your notes.
						</div>
	
							
										<%
																			}
																		%>
					</div>
					<div id="notesInput">
						<form action="noteservlet" method="get">
							<select name="priority">
								<option value="High">High</option>
								<option value="Medium">Medium</option>
								<option value="Low">Low</option>
							</select> <input type="text" name="note" size="133" maxlength="75" /> <input
								type="submit" value="Post!" />
						</form>
					</div>



				</div>
			</div>

			<!-- SCHEDULEPAGE CONTENT -->
			<script type="text/javascript">
<%!public String getCurrentWeekOfYear() {
		Calendar calendar = GregorianCalendar.getInstance();
		int weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);
		String week = convertSimple(weekOfYear);
		return week;
	}

	public void getCurrentDate() {
		Calendar calendar = GregorianCalendar.getInstance();
		int dateDay = calendar.get(Calendar.DAY_OF_MONTH);
		int dateMonth = calendar.get(Calendar.MONTH) + 1;
		int dateYear = calendar.get(Calendar.YEAR);
	}

	public String getDateFromDay(int day) {

		Calendar calendar = GregorianCalendar.getInstance();
		int dag = 1;
		if (day == 1) {
			dag = 2;
		}//MONDAY
		if (day == 2) {
			dag = 3;
		}//TUESDAY
		if (day == 3) {
			dag = 4;
		}//WEDNESDAY
		if (day == 4) {
			dag = 5;
		}//THURSDAY
		if (day == 5) {
			dag = 6;
		}//FRIDAY
		if (day == 6) {
			dag = 7;
		}//SATURDAY
		if (day == 7) {
			dag = 1;
		}//SUNDAY
		calendar.set(Calendar.DAY_OF_WEEK, dag);
		int datumDag = calendar.get(Calendar.DAY_OF_MONTH);
		int datumMaand = calendar.get(Calendar.MONTH) + 1;
		int datumJaar = calendar.get(Calendar.YEAR);
		String dateDay = "";
		String dateMonth = "";
		if (datumDag < 10) {
			dateDay = "0" + convertSimple(datumDag);
		} else {
			dateDay = convertSimple(datumDag);
		}
		if (datumMaand < 10) {
			dateMonth = "0" + convertSimple(datumMaand);
		} else {
			dateMonth = convertSimple(datumMaand);
		}
		String dateYear = convertSimple(datumJaar);
		String result = dateDay + "/" + dateMonth + "/" + dateYear;
		return result;
	}

	public void getDateFromWeekAndDay(int week, int day) {
		Date date = new Date();
		Calendar calendar = GregorianCalendar.getInstance();
		calendar.set(Calendar.WEEK_OF_YEAR, week);
		int dag = 1;
		if (day == 1) {
			dag = 2;
		}//MONDAY
		if (day	== 2) {
			dag = 3;
		}//TUESDAY
		if (day == 3) {
			dag = 4;
		}//WEDNESDAY
		if (day == 4) {
			dag = 5;
		}//THURSDAY
		if (day == 5) {
			dag = 6;
		}//FRIDAY
		if (day == 6) {
			dag = 7;
		}//SATURDAY
		if (day == 7) {
			dag = 1;
		}//SUNDAY
		calendar.set(Calendar.DAY_OF_WEEK, dag);
		int dateDay = calendar.get(Calendar.DAY_OF_MONTH);
		int dateMonth = calendar.get(Calendar.MONTH) + 1;
		int dateYear = calendar.get(Calendar.YEAR);
	}%>
</script>
			<div id="contentDivSchedule" class="contentDiv">
				<div id="volgendeWeek" class="weekText">volgende</div>
				<div id="vorigeWeek" class="weekText">vorige |</div>
				<div class="weekText" id="theScheduledWeek">Week <%=getCurrentWeekOfYear()%></div>
				<%
					if (user != null) {
						activityManager AM = activityManager.getInstance();
						ArrayList<Activity> activityList = AM
								.getAllUserActivities(user);
						for (Activity a : activityList) {
							String name = "null";
							String description = "";
							String color = "#123456";
							Date startDate = new Date();
							Date stopDate = new Date();
							String week = "";

							if (a.getName() != null) {
								name = a.getName();
							}
							if (a.getDescription() != null) {
								description = a.getDescription();
							}
							if (a.getStartDate() != null) {
								startDate = a.getStartDate();
							}
							if (a.getStopDate() != null) {
								stopDate = a.getStopDate();
							}
							if (a.getWeek() != null) {
								week = a.getWeek();
							}

							SimpleDateFormat dateformatDDMMYYYY = new SimpleDateFormat(
									"dd/MM/yyyy");

							long length = stopDate.getTime() - startDate.getTime();
							long hours = length / 3600000;
							long minutes = (length - (hours * 3600000)) / 60000;

							StringBuilder startDateString = new StringBuilder(
									dateformatDDMMYYYY.format(startDate));
							StringBuilder stopDateString = new StringBuilder(
									dateformatDDMMYYYY.format(stopDate));

							String marginLeft = "";
							String day = startDate.toString().substring(0, 3);
							if (day.equals("Mon")) {
								marginLeft = "418.2px";
							}
							if (day.equals("Tue")) {
								marginLeft = "537px";
							}
							if (day.equals("Wed")) {
								marginLeft = "655px";
							}
							if (day.equals("Thu")) {
								marginLeft = "773px";
							}
							if (day.equals("Fri")) {
								marginLeft = "892px";
							}

							String marginTop = "";
							String startHour = startDate.toString().substring(11, 16);
							if (startHour.equals("07:00")) {
								marginTop = "64.7px";
							}
							if (startHour.equals("07:30")) {
								marginTop = "84.7px";
							}
							if (startHour.equals("08:00")) {
								marginTop = "104.7px";
							}
							if (startHour.equals("08:30")) {
								marginTop = "124.7px";
							}
							if (startHour.equals("09:00")) {
								marginTop = "144.7px";
							}
							if (startHour.equals("09:30")) {
								marginTop = "164.7px";
							}
							if (startHour.equals("10:00")) {
								marginTop = "184.7px";
							}
							if (startHour.equals("10:30")) {
								marginTop = "204.7px";
							}
							if (startHour.equals("11:00")) {
								marginTop = "224.7px";
							}
							if (startHour.equals("11:30")) {
								marginTop = "244.7px";
							}
							if (startHour.equals("12:00")) {
								marginTop = "264.7px";
							}
							if (startHour.equals("12:30")) {
								marginTop = "284.7px";
							}
							if (startHour.equals("13:00")) {
								marginTop = "304.7px";
							}
							if (startHour.equals("13:30")) {
								marginTop = "324.7px";
							}
							if (startHour.equals("14:00")) {
								marginTop = "344.7px";
							}
							if (startHour.equals("14:30")) {
								marginTop = "364.7px";
							}
							if (startHour.equals("15:00")) {
								marginTop = "384.7px";
							}
							if (startHour.equals("15:30")) {
								marginTop = "404.7px";
							}
							if (startHour.equals("16:00")) {
								marginTop = "424.7px";
							}
							if (startHour.equals("16:30")) {
								marginTop = "444.7px";
							}
							if (startHour.equals("17:00")) {
								marginTop = "464.7px";
							}
							if (startHour.equals("17:30")) {
								marginTop = "484.7px";
							}
							if (startHour.equals("18:00")) {
								marginTop = "504.7px";
							}
							if (startHour.equals("18:30")) {
								marginTop = "524.7px";
							}
							if (startHour.equals("19:00")) {
								marginTop = "544.7px";
							}
							if (startHour.equals("19:30")) {
								marginTop = "564.7px";
							}
							if (startHour.equals("20:00")) {
								marginTop = "584.7px";
							}

							String height = "";
							long durationInMinutes = length / 60000;
							if (durationInMinutes <= 30) {
								height = "16px";
							}
							if (durationInMinutes > 30 && durationInMinutes <= 60) {
								height = "36px";
							}
							if (durationInMinutes > 60 && durationInMinutes <= 90) {
								height = "56px";
							}
							if (durationInMinutes > 90 && durationInMinutes <= 120) {
								height = "76px";
							}
							if (durationInMinutes > 120 && durationInMinutes <= 150) {
								height = "96px";
							}
							if (durationInMinutes > 150 && durationInMinutes <= 180) {
								height = "116px";
							}
							if (durationInMinutes > 180 && durationInMinutes <= 210) {
								height = "136px";
							}
							if (durationInMinutes > 210 && durationInMinutes <= 240) {
								height = "156px";
							}
							if (durationInMinutes > 240 && durationInMinutes <= 270) {
								height = "176px";
							}
							if (durationInMinutes > 260 && durationInMinutes <= 300) {
								height = "196px";
							}
							if (durationInMinutes > 300 && durationInMinutes <= 330) {
								height = "216px";
							}
							if (durationInMinutes > 330 && durationInMinutes <= 360) {
								height = "236px";
							}
							if (durationInMinutes > 360 && durationInMinutes <= 390) {
								height = "256px";
							}
							if (durationInMinutes > 390 && durationInMinutes <= 420) {
								height = "276px";
							}
							if (durationInMinutes > 420 && durationInMinutes <= 450) {
								height = "296px";
							}
							if (durationInMinutes > 480 && durationInMinutes <= 510) {
								height = "316px";
							}
							if (durationInMinutes > 510 && durationInMinutes <= 540) {
								height = "336px";
							}
							if (durationInMinutes > 540 && durationInMinutes <= 570) {
								height = "356px";
							}
							if (durationInMinutes > 600 && durationInMinutes <= 630) {
								height = "376px";
							}
							if (durationInMinutes > 630 && durationInMinutes <= 660) {
								height = "396px";
							}
							if (durationInMinutes > 660 && durationInMinutes <= 690) {
								height = "416px";
							}
							if (durationInMinutes > 690 && durationInMinutes <= 720) {
								height = "436px";
							}
							if (durationInMinutes > 720 && durationInMinutes <= 750) {
								height = "456px";
							}
							if (durationInMinutes > 750 && durationInMinutes <= 780) {
								height = "476px";
							}
				%><div class="activityDiv"><%=name%>&<br /><%=description%>}<%=marginLeft%>!<%=marginTop%>?<%=height%>*<%=week%></div>
				<%
					}
					}
				%>

				<table id="scheduleTable" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<th width="10%">Uur</th>
						<th id="mondayText" width="18%">Maandag<br />
						<div id="mondayDate"><%=getDateFromDay(1)%></div></th>
						<th id="tuesdayText" width="18%">Dinsdag<br />
						<div id="tuesdayDate"><%=getDateFromDay(2)%></div></th>
						<th id="wednesdayText" width="18%">Woensdag<br />
						<div id="wednesdayDate"><%=getDateFromDay(3)%></div></th>
						<th id="thursdayText" width="18%">Donderdag<br />
						<div id="thursdayDate"><%=getDateFromDay(4)%></div></th>
						<th id="fridayText" width="18%">Vrijdag<br />
						<div id="fridayDate"><%=getDateFromDay(5)%></div></th>
					</tr>
					<tr>
						<td>7:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>7:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>8:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>8:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>9:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>9:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>10:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>10:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>11:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>11:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>12:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>12:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>13:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>13:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>14:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>14:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>15:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>15:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>16:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>16:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>17:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>17:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>18:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>18:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>19:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>19:30</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<td>20:00</td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
						<td class="scheduleTime" onclick="displayResult(this)"></td>
					</tr>
					<tr>
						<th width="10%">Uur</th>
						<th width="18%">Maandag</th>
						<th width="18%">Dinsdag</th>
						<th width="18%">Woensdag</th>
						<th width="18%">Donderdag</th>
						<th width="18%">Vrijdag</th>
					</tr>
				</table>
			<div id="scheduleInputContainer">
				<%
					if (user != null) {
				%>
				<form action="activityServlet" method="get" id="activityForm">
					<div class="header">Create a new activity:</div>
					<div id="scheduleInputContent">
						<div class="scheduleInputTag">Activity Name:</div> 
						<input type="text" id="name"name="name" size="50" maxlength="25" /> <br /> 
						<div class="scheduleInputTag">Extra info:</div> 
						<input type="text" id="description" name="description" size="50" maxlength="25" /> <br /> 
						<div class="scheduleInputTag">Duur(min):</div>
						<input type="text" id="lengte" name="lengte" size="3" maxlength="3" /> <br /> 
						<div>Select a starttime to fill in the following.</div>
						<div id="start">Start:</div>
						<input type="hidden" name="start" size="10" maxlength="10" />
						<div id="date">Date:</div> 
						<input type="hidden" name="date" size="10" maxlength="10" />
						<div id="week">Week:</div>
						<input type="hidden" name="week" size="10" maxlength="10" />
						<input type="submit" value="Create!" id="activitySubmitButton" />
					</div>
				</form>


				<%
					} else {
				%>
				<b><a
					href="<%=userService.createLoginURL(request.getRequestURI())%>">Please
						sign in</a> to view and create activities.</b>
				<%
					}
				%>
			</div>
		</div>
			<!-- /contentDivSchedule -->

		</div>
		</div>
		<!-- /MIDDLESECTION -->
</body>
</html>